.contextual
  %span Your current wip:
  = link_to "#{User.current.wip} ", my_page_path(), :id => "my-wip"
  %span  Limit:
  = link_to "#{User.current.wip_limit} ", edit_user_path(User.current.id), :id => "my-wip-limit"
  = link_to l(:label_kanban_new), new_project_kanban_path(@project.id), :class => 'icon icon-add'
%h2 Kanbans

/ = javascript_include_tag 'kanban.js', :plugin => 'scrum2b' %>
= stylesheet_link_tag 'kanban', :plugin => :ekanban
= stylesheet_link_tag "jQuery-Gantt-style", :plugin => :ekanban
= javascript_include_tag "jquery-1.8.2.js", :plugin => :ekanban
/= stylesheet_link_tag "http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css"
/= stylesheet_link_tag "jquery-ui-1.9.2.css", :plugin => :ekanban
= javascript_include_tag "jquery-ui-1.9.2.js", :plugin => :ekanban
= javascript_include_tag "jquery.fn.gantt.js", :plugin => :ekanban
= javascript_include_tag "select_list_move"
= javascript_include_tag "kanban", :plugin => :ekanban
= javascript_include_tag "kanban_api", :plugin => :ekanban
= javascript_include_tag "sorttable.js", :plugin => :ekanban

:javascript
  function kanbanAjaxCall(type,url,params,callback){
    $.ajax({
      type: type,
      url:  '#{Redmine::Utils.relative_url_root}' + url,
      dataType: "json",
      data: params,
      cache: false,
      success: function(json){
        callback(json,0);
      },
      error: function (XMLHttpRequest, textStatus, errorThrown){
        callback(XMLHttpRequest,XMLHttpRequest.status);
      }
    });
  }

#kanban_filter
  = render :partial => "filter_board"

/ = stylesheet_link_tag 'version', :plugin => 'kanbans'
#kanban_boards{:style => "clear:both"}
  = render :partial => "kanban_board", :collection => @kanbans, :as => :kanban

#popupWindow{:title => "Edit kanban card"}
  #popupWindowBody
    = render :partial => "kanban_card"
  #popupWindowFoot

/ Get rails variables from templates.
= content_tag "div", "", :id => "kanban-data"
= content_tag "div", "", :id => "my-profile", :data => {:user => @user, :roles => @roles}
= content_tag "div", "", :id => "project-profile", :data => {:project => @project}

:javascript
  $(function() {
    // Ignore case in contains()
    $.expr[":"].contains = $.expr.createPseudo(function(arg) {
      return function( elem ) {
        return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
      };
    });

    $( document ).ready(function(){
      kanban_init();
    });
  });
